# -*- coding: utf-8 -*-
# @Time    : 2020/9/14 18:37
# @Author  : Mr. Cui
# @File    : service.py
# @Software: PyCharm
from application.libs.db import DataBaseHandle
#
# DB = DataBaseHandle('117.50.17.66', 'mantis', '6EJt2RYnAYGPaL4z', 'bugtracker', 3306)
#
# def get_group():
#     sql = "select a.id,a.name from mantis_project_table as a,mantis_project_hierarchy_table as b " \
#           "where a.id = b.parent_id and a.enabled =1 " \
#           "group by a.id"
#     ret=DB.selectDb(sql)
#     data=[{"group_id":i,"group_name":j} for i,j in ret[1]]
#     return data
#
# def get_project(group_id):
#     sql = "select p.id,p.name " \
#           "from mantis_project_table as p,mantis_project_hierarchy_table as h " \
#           "where p.id = h.child_id and h.parent_id=%s"
#     args=(group_id,)
#     ret=DB.selectDb(sql,args)
#     data=[{"projtct_id":i,"projtct_name":j} for i,j in ret[1]]
#     return data